<template>
  <el-container>
    <el-header>
      <img src="../assets/images/logo.png" alt />
      <span class="title">电商后台管理系统</span>
      <el-button type="info">退出</el-button>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-row unique-opened="true" class="tac">
          <el-col :span="24">
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
            >
              <el-submenu index="1">
                <template slot="title">
                  <i class="el-icon-location iconfont icon-duoyonghu"></i>
                  <span>用户管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1">
                    <i class="secondList iconfont icon-user-list"></i>用户列表
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-location iconfont icon-quanxian"></i>
                  <span>权限管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="2-1" @click="roles">
                    <i class="secondList iconfont icon-user-list"></i>角色列表
                  </el-menu-item>
                  <el-menu-item index="2-2" @click="permise">
                    <i class="secondList iconfont icon-permissions-list"></i>权限列表
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-location iconfont icon-shangpinguanli"></i>
                  <span>商品管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1">
                    <i class="secondList iconfont icon-shangpinliebiao"></i>商品列表
                  </el-menu-item>
                  <el-menu-item index="3-2">
                    <i class="secondList iconfont icon-canshu"></i>分类参数
                  </el-menu-item>
                  <el-menu-item @click="kinds" index="3-3">
                    <i class="secondList iconfont icon-shangpinfenlei"></i>商品分类
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <el-submenu index="4">
                <template slot="title">
                  <i class="el-icon-location iconfont icon-dingdan"></i>
                  <span>订单管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="4-1" @click="orderManage">
                    <i class="secondList iconfont icon-dingdanliebiao"></i>订单列表
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <el-submenu index="5">
                <template slot="title">
                  <i class="el-icon-location iconfont icon-shujubaobiao"></i>
                  <span>数据统计</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="5-1">
                    <i class="secondList iconfont icon-shuju"></i>数据报表
                  </el-menu-item>
                </el-menu-item-group>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  components: {  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    // handleOpen(key, keyPath) {
    //   console.log(key, keyPath);
    // },
    // handleClose(key, keyPath) {
    //   console.log(key, keyPath);
    // },
    kinds(){
      this.$router.push('/kinds')
    },
    orderManage(){
      this.$router.push('/ordermanage');
    },
    roles(){
      this.$router.push('/roles');
    },
    permise(){
      this.$router.push('/permise');
    }
  },
  created() {},
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
.el-container {
  height: 100%;
  .el-header {
    background-color: #373d41;
    display: flex;
    align-items: center;
    position: relative;
    img {
      width: 60px;
      height: 60px;
    }
    .title {
      color: white;
      font-size: 22px;
    }
    .el-button {
      position: absolute;
      right: 10px;
    }
  }

  .el-container {
    .el-aside {
      .el-menu-vertical-demo {
        border: none;
      }
      background-color: #333744;
    }
    .el-menu-item-group {
      .el-menu-item {
        position: relative;
        text-align: center;
      }
      .secondList {
        position: absolute;
        top: -1px;
        left: 48px;
      }
    }
    .el-main {
      width: 100%;
      background-color: #eaedf1;
    }
  }
}
</style>